import Vue from "vue";
import Vuex from "vuex";
import $ from "@/common/js/axios";

Vue.use(Vuex);
export default new Vuex.Store({
  state: {
    person: {}
  },
  mutations: {
    gerusers(state, obj) {
      state.person = obj;
      sessionStorage.setItem('person', JSON.stringify(obj));
    }
  },
  actions: {
    getUsers({
      commit
    }) {
      $({
        url: '/dafwgl/personal/jbxxCx',
        method: 'get'
      }).then((res) => {
        let _data = res.returnData;
        commit('gerusers', _data.grxx);
      })
    }
  }
})
